/*
 *  HeartBeatController.h
 *  project8
 *
 *  Created by Luca Gobbo on 21-06-10.
 *  Copyright 2010 __MyCompanyName__. All rights reserved.
 *
 */

#ifndef _SPEAKERSWITCH_H
#define _SPEAKERSWITCH_H

#include "pRTOS.h"
#include "Speaker.h"


class SpeakerSwitch : public cTask  
{
	
	
public:
    SpeakerSwitch() :cTask("SpeakerSwitchTask", 1, 2500 US)  {};

    void init(void);
    void update(void);
    void switchOn(int freq, int period);
    void switchOff(void);
private:
  enum Status {
    OFF,
    ON,
    HIGH,
    LOW
  };
  Status state;
  Speaker theSpeaker;
  
  int nrTicks;
  int maxTicks;
  int timeTicks;
    
};


#endif